//简单的顶点着色器，假定了顶点的数据为：
//位置，法线，贴图UV

#version 450
#extension GL_ARB_separate_shader_objects : enable

//输入-顶点布局：
layout( location = 0 ) in vec4 vPosition;	
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 TexCoord;

//输出-到像素着色器
layout(location = 0) out vec3 vs_fs_normal;
layout(location = 1) out vec2 vs_fs_TexCoord;
layout(location = 2) out vec3 vs_fs_worldPosition;

//UniformBuffer
layout(binding = 7) uniform SceneData {
	mat4 view;
	mat4 proj;
	vec4 lightDir;
	vec4 eyePosition;
	vec4 TestValue;
} ub_SceneData;

layout(binding = 6) uniform ModelData {
	mat4 transform;
} ub_ModelData;

void main()
{
    gl_Position = ub_SceneData.proj * ub_SceneData.view * ub_ModelData.transform * vPosition;
	vs_fs_normal = normal;
	vs_fs_TexCoord = TexCoord;
	vs_fs_worldPosition = (ub_ModelData.transform * vPosition).xyz;
}
